package world.snowcrystal;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

@SpringBootApplication
@EnableAspectJAutoProxy
@MapperScan("world.snowcrystal.mapper")
@ConfigurationPropertiesScan("world.snowcrystal.properties")
public class SnowcrystalApplication {

    public static void main(String[] args) {
        SpringApplication.run(SnowcrystalApplication.class,args);
    }

    // 避免循环依赖
    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }

}
